<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/templates/template.xhtml">
	<ui:define name="content">
		<h:form id="Cadastro">

			<p:panel id="Janela" header="Novo Aeroporto">

				<p:messages id="msgs" />

				<h:panelGrid columns="3">

					<h:outputText for="codigo" value="Código: *" />
					<p:inputText id="codigo" value="#{aeroportoController.aeroporto.codigo}"
						required="true" label="Codigo">
						<f:validateLength minimum="3" maximum="3" />
					</p:inputText>
					<p:message for="codigo" display="icon" />

					<h:outputText for="nome" value="Nome: *" />
					<p:inputText id="nome" value="#{aeroportoController.aeroporto.nome}"
						required="true" label="Nome">
						<f:validateLength minimum="3" />
					</p:inputText>
					<p:message for="nome" display="icon" />

					<h:outputText for="cidade" value="Cidade:*" />
					<p:inputText id="cidade" value="#{aeroportoController.aeroporto.cidade}"
						label="Cidade" required="true">
						<f:validateLength minimum="3" />
					</p:inputText>
					<p:message for="cidade" display="icon" />
					
					<h:outputText for="pais" value="País:*" />
					<p:inputText id="pais" value="#{aeroportoController.aeroporto.pais}"
						label="País" required="true">
						<f:validateLength minimum="3" />
					</p:inputText>
					<p:message for="pais" display="icon" />

					<h:outputText for="internacional"
						value="Realiza voos internacionais? *" />
					<p:selectOneRadio id="internacional"
						value="#{aeroportoController.aeroporto.internacional}" required="true"
						label="Internacional">
						<f:selectItem itemLabel="Internacional" itemValue="true" />
						<f:selectItem itemLabel="Nacional" itemValue="false" />
					</p:selectOneRadio>
					<p:message for="internacional" display="icon" />

				</h:panelGrid>

				<p:commandButton id="btn" value="Cadastrar" update="Janela"
					action="#{aeroportoController.cadastraAeroporto}" ajax="false" />



			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>